<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Mebcard.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table"
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/mall/Mebcard.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '卡列表',
                    name: 'Mebcard',
                    url: "/Mebcard/",
                    sortName: "createDate"
                },
                extend: extend,
                editFormFields: {cardno:"",memberid:"",creator:"",createDate:"",description:"",validatedate:"",quota:"",is_quota:"",is_realname:""},
                editFormOptions: [
                    [{field:'cardno',title:'卡号',type:'text', disabled: true}],
                    [{field:'is_quota',title:'是否定额',type:'switch'},{field:'quota',title:'卡面额',type:'text',hidden: true}],
                    [{field:'is_realname',title:'是否记名',type:'switch'}],
                    [{field:'description',title:'描述',type:'textarea'}],
                ],
                searchFormFields: {cardno:"",memberid:"",cardstatus:"",cardtype:""},
                searchFormOptions: [
                    [{field:'cardno',title:'卡号',type:'string',"type":"like"},
                    {field:'memberid',title:'会员手机号',type:'string',"type":"like"}],
                    [{field:'cardstatus',title:'卡状态',type:'select',dataKey:'MebCardStatus',data:[]},
                    {field:'cardtype',title:'卡模板',type:'string',type:'select',dataKey:'MebCardType',data:[]}]
                    ],
                columns: [
                        {field:'cardno',title:'卡号',type:'string',width:170,align:'left'},
                        {field:'memberid',title:'会员手机号',type:'string',width:120,align:'left'},
                         {field:'cardstatus',title:'卡状态',type:'int',width:100,align:'left',bind:{key:'MebCardStatus',data:[]}},
                         {field:'cardtype',title:'卡模板',type:'int',width:150,align:'left',bind:{key:'MebCardType',data:[]}},
                        {field:'is_quota',title:'是否定额',type:'int',bind: { key: '', data: [{key: false, value: '否'},{key: true, value: '是'}] },width:80,align:'left'},
                        {field:'discount',title:'是否打折',type:'string',width:120,align:'left',bind:{key:'IsDiscount',data:[]}},
                       {field:'is_realname',title:'是否记名',type:'string',width:120,align:'left',bind:{key:'',data:[{ key: false, value: '否' }, { key: true, value: '是' }]}},
                        {field:'balance',title:'余额',type:'decimal',width:120,align:'left'},
                        {field:'denomination',title:'面值',type:'decimal',width:120,align:'left'},
                       {field:'opendate',title:'发卡日期',type:'datetime',width:120,align:'left'},
                       {field:'validatedate',title:'开始使用时间',type:'datetime',width:170},
                       {field:'validendatedate',title:'有效截止日期',type:'datetime',width:170},
                       {field:'card_day',title:'有效期固定天数',type:'datetime',width:170},
                       {field:'description',title:'描述',type:'string',width:120,align:'left'},
                       {field:'creator',title:'创建人',type:'string',width:120,align:'left'},
                       {field:'createDate',title:'创建时间',type:'datetime',width:170,align:'left',sortable:true},
                       {field:'modifier',title:'修改人',type:'string',width:120,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',width:170,align:'left',sortable:true},
                       ],
                detail: {
                    cnName:"#detailCnName",
                    columns: [],
                    sortName: "",
                    key:""
                }
            };
        }
    };
    export default vueParam;
</script>
